home *** CD-ROM | disk | FTP | other *** search
/ 3D GFX / 3D GFX.iso / amiutils / i_l / irit5 / grapdrvs / nuldrvs.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-12-31  |  7.4 KB  |  147 lines

  1. /*****************************************************************************
  2. *   A NUL device driver. Prints the objects it recieves from server.         *
  3. *                                         *
  4. * Written by:  Gershon Elber                Ver 0.1, June 1993.  *
  5. *****************************************************************************/
  6.  
  7. #include "irit_sm.h"
  8. #include "iritprsr.h"
  9. #include "allocate.h"
  10. #include "attribut.h"
  11. #include "iritgrap.h"
  12.  
  13. /*****************************************************************************
  14. * DESCRIPTION:                                                               M
  15. * Main module of nuldrvs - NUL graphics driver of IRIT.                      M
  16. *                                                                            *
  17. * PARAMETERS:                                                                M
  18. *   argc, argv:  Command line.                                               M
  19. *                                                                            *
  20. * RETURN VALUE:                                                              M
  21. *   int:         Exit code.                                                  M
  22. *                                                                            *
  23. * KEYWORDS:                                                                  M
  24. *   main                                                                     M
  25. *****************************************************************************/
  26. void main(int argc, char **argv)
  27. {
  28.     IPObjectStruct
  29.     *PObjects = NULL;
  30.  
  31.     IGConfigureGlobals("nuldrvs", argc, argv);
  32.     IGProcessCommandMessages(FALSE);
  33.  
  34.     if (IGGlblStandAlone) {
  35.     fprintf(stderr, "NULDrvs has no meaning running stand alone.\n");
  36.     exit(1);
  37.     }
  38.  
  39.     if (!IGGlblDebugObjectsFlag && !IGGlblDebugEchoInputFlag) {
  40.     fprintf(stderr, "NULDrvs is pretty useless with neither -d nor -D.\n");
  41.     exit(1);
  42.     }
  43.  
  44.     while (TRUE) {
  45.     IGReadObjectsFromSocket(IGGlblViewMode, &PObjects);
  46.     if (PObjects != NULL && IP_IS_STR_OBJ(PObjects)) {
  47.         if (strcmp(PObjects -> U.Str, "EXIT") == 0)
  48.         break;
  49.  
  50.         IPFreeObjectList(PObjects);
  51.         PObjects = NULL;
  52.     }
  53.     IritSleep(10);
  54.     }
  55.  
  56.     exit(0);
  57. }
  58.  
  59. /*****************************************************************************
  60. * DESCRIPTION:                                                               M
  61. * Handles the events of the pop up window.                                   M
  62. *                                                                            *
  63. * PARAMETERS:                                                                M
  64. *   State:      Event to handle.                                             M
  65. *   Refresh:    Do we need to refresh the screen according to what we know   M
  66. *        on entry.                             M
  67. *                                                                            *
  68. * RETURN VALUE:                                                              M
  69. *   int:        TRUE, if we need to refresh the screen.                      M
  70. *                                                                            *
  71. * KEYWORDS:                                                                  M
  72. *   IGHandleState                                                            M
  73. *****************************************************************************/
  74. int IGHandleState(int State, int Refresh)
  75. {
  76.      return FALSE;
  77. }
  78.  
  79. /*****************************************************************************
  80. * DESCRIPTION:                                                               M
  81. * Make some sound.                                                           M
  82. *                                                                            *
  83. * PARAMETERS:                                                                M
  84. *   None                                                                     M
  85. *                                                                            *
  86. * RETURN VALUE:                                                              M
  87. *   void                                                                     M
  88. *                                                                            *
  89. * KEYWORDS:                                                                  M
  90. *   IGIritBeep                                                               M
  91. *****************************************************************************/
  92. void IGIritBeep(void)
  93. {
  94. }
  95.  
  96. /*****************************************************************************
  97. * DESCRIPTION:                                                               M
  98. * Optionally construct a state pop up menu for the driver, if has one.       M
  99. *                                                                            *
  100. * PARAMETERS:                                                                M
  101. *   None                                                                     *
  102. *                                                                            *
  103. * RETURN VALUE:                                                              M
  104. *   void                                                                     M
  105. *                                                                            *
  106. * KEYWORDS:                                                                  M
  107. *   IGCreateStateMenu                                                        M
  108. *****************************************************************************/
  109. void IGCreateStateMenu(void)
  110. {
  111. }
  112.  
  113. /*****************************************************************************
  114. * DESCRIPTION:                                                               M
  115. * Redraws the view window.                             M
  116. *                                                                            *
  117. * PARAMETERS:                                                                M
  118. *   None                                                                     M
  119. *                                                                            *
  120. * RETURN VALUE:                                                              M
  121. *   void                                                                     M
  122. *                                                                            *
  123. * KEYWORDS:                                                                  M
  124. *   IGRedrawViewWindow                                                       M
  125. *****************************************************************************/
  126. void IGRedrawViewWindow(void)
  127. {
  128. }
  129.  
  130. /*****************************************************************************
  131. * DESCRIPTION:                                                               M
  132. *   Should we stop this animation. Senses the event queue of X11.            M
  133. *                                                                            *
  134. * PARAMETERS:                                                                M
  135. *   Anim:     The animation to abort.                                        M
  136. *                                                                            *
  137. * RETURN VALUE:                                                              M
  138. *   int:      TRUE if we need to abort, FALSE otherwise.                     M
  139. *                                                                            *
  140. * KEYWORDS:                                                                  M
  141. *   AnimCheckInterrupt                                                       M
  142. *****************************************************************************/
  143. int AnimCheckInterrupt(AnimationStruct *Anim)
  144. {
  145.     return FALSE;
  146. }
  147.